package com.googlecode.vanaraha.utils
import org.apache.commons.logging.Log

class Logger(val logger: Log) {
  def debug(str: String, values:Any*)  = if(logger.isDebugEnabled) logger.debug(str.format(values: _*))

  def info(str: String, values: Any*)  = if(logger.isInfoEnabled)  logger.info(str.format(values: _*))
  
  def warn(str: String, values: Any*)  = if(logger.isWarnEnabled)  logger.warn(str.format(values: _*))
  
  def fatal(str: String, values: Any*) = if(logger.isFatalEnabled) logger.fatal(str.format(values: _*))
  
  def fatal(e: Throwable, str: String, values: Any*) = 
    if(logger.isFatalEnabled) 
      logger.fatal(str.format(values: _*), e)
  
  def error(e: Throwable) = if(logger.isErrorEnabled) logger.error(e)
  
  def isDebugEnabled = logger.isDebugEnabled
  def isInfoEnabled  = logger.isInfoEnabled
  def isWarnEnabled  = logger.isWarnEnabled
  def isFatalEnabled = logger.isFatalEnabled
}
